package net.knightwatch.kwtools.database; 

import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

public class QuestionTable {
	// Class Information
			private static final String TAG = "QuestionTable";
			// Database Table
			public static final String TABLE_QUESTION = "Questions";
			public static final String COLUMN_ID = "_id";
			public static final String COLUMN_PARENT_ID = "parentId";
			public static final String COLUMN_ITEM_TYPE_ID = "itemTypeId";
			public static final String COLUMN_ANSWER_TYPE_ID = "answerTypeId";
			public static final String COLUMN_QUESTION = "question";
			
			// Database Creation SQL Statement
			private static final String DATABASE_CREATE = "create table " 
					+ TABLE_QUESTION
					+ "("
					+ COLUMN_ID + " integer primary key autoincrement, "
					+ COLUMN_PARENT_ID + " integer not null,"
					+ COLUMN_ITEM_TYPE_ID + " integer not null,"
					+ COLUMN_ANSWER_TYPE_ID + " integer not null,"
					+ COLUMN_QUESTION + " text not null"					
					+ ");";
			
			
			public static void onCreate(SQLiteDatabase database) {
				Log.i(TAG, "Creating " + TABLE_QUESTION + " Table");
				try {
					database.execSQL(DATABASE_CREATE);
				} catch (Exception e){
					Log.v(TAG, e.toString());
				} finally {
					Log.d(TAG, "Table " + TABLE_QUESTION + " has been created.");
				}
			}
			public static void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion){
				
			}
}
